package com.cmower.dzone;

import java.util.stream.IntStream;

/**
 * @author 沉默王二，一枚有趣的程序员
 */
public class AvoidFunctionalVomit {
    public static void main(String[] args) {
        IntStream.range(1, 5).boxed().map(i -> {
            System.out.print("Happy Birthday ");
            if (i == 3) return "dear NAME";
            else return "to You";
        }).forEach(System.out::println);

System.out.println();
for (int i = 1; i < 5; i++) {
    System.out.println("Happy Birthday " + (i == 3 ? "dear NAME" : "to you"));
}

Thread t1 = new Thread(new Runnable() {
    @Override
    public void run() {
        System.out.println("匿名内部类，搞起来");
    }
});
t1.start();


Thread t2 = new Thread(() -> {
    System.out.println("Lambda 表达式，搞起来");
});
t2.start();
    }
}
